{$CLEO .cs}
0000:

  
model.Load(#BANSHEE)
model.Load(#INFERNUS)
model.Load(#BULLET)
model.Load(#STALLION)
model.Load(#SMYST2)
model.Load(#BMOTR1)
model.Load(#BIKDRUG)
model.Load(#COPCARVG)
model.Load(#LVPD1)
model.Load(#COLT45)
model.Load(#DESERT_EAGLE)
038B: load_requested_models
 
const
   COP1 = 7@
   COP2 = 8@
   COP3 = 9@
   COP4 = 10@
   COP5 = 11@
   COP6 = 12@
   COP7 = 13@
   COP8 = 14@
   car1 = 15@
   car2 = 16@
   car3 = 17@
   car4 = 18@
   car5 = 19@
   car6 = 20@
   icon_marker =  29@
    Cops_spawned_in = 30@
end

   //Playing walking to the marker
   icon_marker = marker.CreateIconAndSphere( 53, 2007.0227, 2096.6223, 10.8203 )
   while true
   wait 0 
       if   and
             00FE:   actor player1 sphere 0 in_sphere  2007.0227 2096.6223 10.8203  radius 5.0 5.0 5.0
             not   actor.Driving( player1 )
             02A0:   actor player1 stopped
             $ON_FAKE_MISSION == false 
       then
          fade 0 1000
          wait 1000
          fade 1 1000
          break
       end
       if  $onmission == 0
       then
         jump @end_the_thread
       end     
   end
   
   //double-checking
   while true
   wait 0
      if 
       model.Available(#LVPD1)
      then
         break 
      end
       if  $onmission == 0
       then
         jump @end_the_thread
       end      
   end 
   while true
   wait 0
       if and 
        model.Available(#BANSHEE)
        model.Available(#INFERNUS)
        model.Available(#BULLET)
        model.Available(#STALLION)
        model.Available(#SMYST2)
        model.Available(#BMOTR1)
        model.Available(#BIKDRUG)
        model.Available(#COPCARVG)
       then
         break
       end
       if  $onmission == 0
       then
          jump @end_the_thread
       end
   end
   
    //Begin  mission   
    if marker_enabled  icon_marker
    then
    
       marker.Disable( icon_marker )
    end  
    
    $ON_FAKE_MISSION = true  
    
    Cops_spawned_in = false 

  0@ = car.Create(#BANSHEE ,  1982.899, 2078.071, 10.8203)
  car.Angle( 0@) = 1.0701
  car.Health( 0@ )=10000
  car.SetMaxSpeed( 0@ ,200.0)   
  09C4: set_car 0@ gas_tank_explosion_enabled 0
 // 0423: set_car 0@ improved_handling_to 2.0 // (float)

  1@ = car.Create(#INFERNUS ,  1990.8981, 2078.2195, 10.8203)
  car.Angle( 1@) = 1.0701
  car.Health( 1@ )=10000
  car.SetMaxSpeed( 1@ ,200.0)   
  car.DoorStatus(1@,2)
  09C4: set_car 1@ gas_tank_explosion_enabled 0
//  0423: set_car 1@ improved_handling_to 2.0 // (float)
  
  2@ = car.Create(#BULLET , 1991.5618, 2096.2336, 10.8203 )
  car.Angle( 2@) = 1.0701
  car.Health( 2@ )=10000
  car.SetMaxSpeed( 2@,200.0)   
  09C4: set_car 2@ gas_tank_explosion_enabled 0
//  0423: set_car 2@ improved_handling_to 2.0 // (float)
  car.DoorStatus(2@,2)

  3@ = car.Create(#STALLION ,  1982.5629, 2096.0667, 10.8203)
  car.Angle( 3@) = 1.0701 
  car.Health( 3@ )=10000
  car.SetMaxSpeed( 3@ ,200.0)   
  09C4: set_car 3@ gas_tank_explosion_enabled 0
//  0423: set_car 3@ improved_handling_to 2.0 // (float)
  car.DoorStatus(3@,2)

 4@ = actor.CreateAsDriver(33,#SMYST2,1@ )
 actor.Health(4@)=4000
 0446: set_actor 4@ dismemberment_possible 0

 5@ = actor.CreateAsDriver(33,#SMYST2,2@ )
 actor.Health(5@)=4000
 0446: set_actor 5@ dismemberment_possible 0

 6@ = actor.CreateAsDriver(33,#SMYST2,3@ )
 actor.Health(6@)=4000
 0446: set_actor 6@ dismemberment_possible 0

 00AE: set_car 1@ traffic_behaviour_to 2
 00AE: set_car 2@ traffic_behaviour_to 2
 00AE: set_car 3@ traffic_behaviour_to 2
 car.SetDriverBehaviour(1@, FollowRoad)
 car.SetDriverBehaviour(2@, FollowRoad)
 car.SetDriverBehaviour(3@, FollowRoad)
 car.DriveTo(1@ , 112.4672, 1051.3833, 13.6094)
 car.DriveTo(2@ , 112.4672, 1051.3833, 13.6094)
 car.DriveTo(3@ , 112.4672, 1051.3833, 13.6094)
 $temp_marker1 = marker.CreateAboveActor(4@)
 $temp_marker2 = marker.CreateAboveActor(5@)
 $temp_marker3  = marker.CreateAboveActor(6@)
 {
053F: set_car 1@ tires_vulnerability 0
053F: set_car 3@ tires_vulnerability 0
053F: set_car 2@ tires_vulnerability 0
053F: set_car 0@ tires_vulnerability 0  }
 wait 100
    32@ = 0 
    33@ = 0 
 if coop
 then
    while true
    wait 0 
    show_styled_text "~w~Who's driving? First player presses ~r~~k~~CONVERSATION_YES~ ~w~will get the driver's seat!" 5000 6
        if and
        00E1:   player 0 pressed_key 11
        00E1:   player 1 pressed_key 11
        then
            show_styled_text "~r~Both players cannot drive at the same time! Don't abused it too much!" 5000 6
            wait 1000
            018C: play_sound 1052 at 0.0 0.0 0.0
            if 33@ > 7500
            then
                show_styled_text "~r~Your banned for abusing it! - Now get lost! Bye-Bye!" 5000 6 // - Now leave comeback 500 metres away." 5000 6
                $WAVE += 1 
                jump @banned 
            end
        end
        if  00E1:   player 0 pressed_key 11  
        then
             036A: put_actor player1 in_car 0@
             if coop
             then
                0430: put_actor player2 into_car 0@ passenger_seat 0
                
             end    
             break  
        end
        if  00E1:   player 1 pressed_key 11
        then
             0430: put_actor player1 into_car 0@ passenger_seat 0   
             
             if coop
             then
                036A: put_actor player2 in_car 0@
                
             end   
             break   
        end
        
    end 
 else
     036A: put_actor player1 in_car 0@
     if coop
     then
        0430: put_actor player2 into_car 0@ passenger_seat 0
     end  
 end
 
 
 0167: 31@ = create_marker_at 112.4672 1051.3833 13.6094  color 4 flag 2
 marker.SetIconSize( 31@ , 4 )
 while $onmission >= 1 
 wait 0 
        if
        not actor.Driving( player1)
        then
           show_styled_text "~r~Leaving cars isn't allowed in races!"  4500 5
           0109: player $PLAYER_CHAR money -12500
           break
        end
        if coop 
        then 
            if
            not actor.Driving( player2)
            then
               show_styled_text "~r~Leaving cars isn't allowed in races!"  4500 5
               0109: player $PLAYER_CHAR money -12500
               break
            end
        end 
       if  or 
       00FE:   actor 4@ sphere 0 in_sphere  112.4672 1051.3833 13.6094  radius 25.0 25.0 25.0
       00FE:   actor 5@ sphere 0 in_sphere  112.4672 1051.3833 13.6094  radius 25.0 25.0 25.0
       00FE:   actor 6@ sphere 0 in_sphere  112.4672 1051.3833 13.6094  radius 25.0 25.0 25.0
       then
           show_styled_text "~r~One of the racers make it to the finish line. Seem like you lost bet."  4500 5
           0109: player $PLAYER_CHAR money -12500

           break 
       end
       if
       00FE:   actor player1 sphere 1 in_sphere  112.4672 1051.3833 13.6094  radius 25.0 25.0 25.0
       then
          show_styled_text "~y~You won! Bet is yours!" 4500 5
          0109: player $PLAYER_CHAR money  12500
          $FAKE_MISSION_PASS += 1 
           break
       end
       
       if   and
        32@ > 25000
        Cops_spawned_in == false
       then
       if $WAVE < 2
       then
           $WAVE = 2 
       end
       Cops_spawned_in = true 
           0208: 24@ = random_float_in_ranges 150.0 300.0
           0208: 25@ = random_float_in_ranges 150.0 300.0
           04C4: store_coords_to 21@ 22@ 23@ from_actor player1 with_offset 24@ 25@  0.0 
           02C1: store_to  26@ 27@ 28@ car_path_coords_closest_to  21@ 22@ 23@ 

          car1 = car.Create(#COPCARVG,26@, 27@, 28@ )
          car.Health(car1)=5000
          car.SetMaxSpeed(car1,200.0) 
          0423: set_car car1 improved_handling_to 3.0 // (float)

           0208: 24@ = random_float_in_ranges 150.0 300.0
           0208: 25@ = random_float_in_ranges 150.0 300.0
           04C4: store_coords_to 21@ 22@ 23@ from_actor 4@ with_offset 24@ 25@  0.0 
           02C1: store_to  26@ 27@ 28@ car_path_coords_closest_to  21@ 22@ 23@ 

          car2 = car.Create(#COPCARVG,26@, 27@, 28@ )
          car.Health(car2)=5000
          car.SetMaxSpeed(car2,200.0) 
          0423: set_car car2 improved_handling_to 3.0 // (float)

           0208: 24@ = random_float_in_ranges 150.0 300.0
           0208: 25@ = random_float_in_ranges 150.0 300.0
           04C4: store_coords_to 21@ 22@ 23@ from_actor 5@ with_offset 24@ 25@  0.0 
           02C1: store_to  26@ 27@ 28@ car_path_coords_closest_to  21@ 22@ 23@ 

          car3 = car.Create(#COPCARVG,26@, 27@, 28@ )
          car.Health(car3)=5000
          car.SetMaxSpeed(car3,200.0) 
          0423: set_car car3 improved_handling_to 3.0 // (float)

           0208: 24@ = random_float_in_ranges 150.0 300.0
           0208: 25@ = random_float_in_ranges 150.0 300.0
           04C4: store_coords_to 21@ 22@ 23@ from_actor 6@ with_offset 24@ 25@  0.0 
           02C1: store_to  26@ 27@ 28@ car_path_coords_closest_to  21@ 22@ 23@ 

          car4 = car.Create(#COPCARVG,26@, 27@, 28@ )
          car.Health(car4)=5000
          car.SetMaxSpeed(car4,200.0) 
          0423: set_car car4 improved_handling_to 3.0 // (float)
           
          COP1=actor.CreateAsDriver(cop,#LVPD1,car1) 
          COP2=actor.CreateAsPassenger(cop,#LVPD1,car1,0) 
          actor.GiveWeaponAndAmmo(COP1,pistol, 99999)
          actor.GiveWeaponAndAmmo(COP2,pistol, 99999)
          0713: actor COP2 driveby_actor player1 car -1 point 0.0 0.0 0.0 radius 540.0 4 1 firing_rate 90

          COP3=actor.CreateAsDriver(cop,#LVPD1,car2) 
          COP4=actor.CreateAsPassenger(cop,#LVPD1,car2,0)  
          actor.GiveWeaponAndAmmo(COP3,pistol, 99999)
          actor.GiveWeaponAndAmmo(COP4,pistol, 99999)
          0713: actor COP3 driveby_actor 4@ car -1 point 0.0 0.0 0.0 radius 540.0 4 1 firing_rate 90
          
          COP5=actor.CreateAsDriver(cop,#LVPD1,car3) 
          COP6=actor.CreateAsPassenger(cop,#LVPD1,car3,0) 
          actor.GiveWeaponAndAmmo(COP5,pistol, 99999)
          actor.GiveWeaponAndAmmo(COP6,pistol, 99999)
          0713: actor COP6 driveby_actor 5@ car -1 point 0.0 0.0 0.0 radius 540.0 4 1 firing_rate 90
          
          COP7=actor.CreateAsDriver(cop,#LVPD1,car4) 
          COP8=actor.CreateAsPassenger(cop,#LVPD1,car4,0) 
          actor.GiveWeaponAndAmmo(COP7,pistol, 99999)
          actor.GiveWeaponAndAmmo(COP8,pistol, 99999)
          0713: actor COP8 driveby_actor 6@ car -1 point 0.0 0.0 0.0 radius 540.0 4 1 firing_rate 90
         // 07F8: car car1 follow_car 0@ radius 99999.0
          car.SetDriverBehaviour(car1,KillThePlayer)
          07F8: car car2 follow_car 1@ radius 99999.0
          07F8: car car3 follow_car 2@ radius 99999.0
          07F8: car car4 follow_car 3@ radius 99999.0

       end
       
 end 
 
 :banned
 if and
  is_actor_defined COP1
  is_actor_defined COP2
  is_actor_defined COP3
  is_actor_defined COP4
  is_actor_defined COP5
  is_actor_defined COP6
  is_actor_defined COP7
  is_actor_defined COP8
 then
     actor.RemoveReferences(COP1)
     actor.RemoveReferences(COP2)
     actor.RemoveReferences(COP3)
     actor.RemoveReferences(COP4)
     actor.RemoveReferences(COP5)
     actor.RemoveReferences(COP6)
     actor.RemoveReferences(COP7)
     actor.RemoveReferences(COP8)
 end
 if  
   is_car_defined car1
 then
     car.RemoveReferences(car1)
 end
 if  
   is_car_defined car2
 then
     car.RemoveReferences(car2)
 end
 if  
   is_car_defined car3
 then
     car.RemoveReferences(car3)
 end
 if  
   is_car_defined car4
 then
     car.RemoveReferences(car4)
 end
 actor.RemoveReferences(4@)
 actor.RemoveReferences(5@)
 actor.RemoveReferences(6@)
 car.RemoveReferences(0@)
 car.RemoveReferences(1@)
 car.RemoveReferences(2@)
 car.RemoveReferences(3@)  
$ON_FAKE_MISSION = false  
if marker_enabled $temp_marker1
then
   marker.Disable($temp_marker1)
end
if marker_enabled $temp_marker2
then
   marker.Disable($temp_marker2)
end
if marker_enabled $temp_marker3
then
   marker.Disable($temp_marker3)
end
:end_the_thread
model.Destroy(#BANSHEE)
model.Destroy(#INFERNUS)
model.Destroy(#BULLET)
model.Destroy(#STALLION)
model.Destroy(#SMYST2)
model.Destroy(#BMOTR1)
model.Destroy(#BIKDRUG)
model.Destroy(#COPCARVG)
model.Destroy(#LVPD1)
model.Destroy(#COLT45)
model.Destroy(#DESERT_EAGLE)
if marker_enabled  icon_marker
then

   marker.Disable( icon_marker )
end
0A93: terminate_this_custom_script